//
//  LGFollowDataSymptomHeader.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/6/21.
//

#import "LGFollowDataInOutHeader.h"

@interface LGFollowDataInOutHeader()
/**   */
@property (nonatomic , strong)UIView *shadowView;
/**   */
@property (nonatomic , strong)UIImageView *iconView;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;
/**   */
@property (nonatomic , strong)UIView *segmentView;
/**   */
@property (nonatomic , strong)UIView *baseView;

@end

@implementation LGFollowDataInOutHeader

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

#pragma mark
#pragma mark ====> 创建控件
-(void)createSubView{
    self.clipsToBounds = YES;
    self.backgroundColor = [UIColor colorWithString:@"#F9F9F9"];
    [self addSubview:self.shadowView];
    [self.shadowView addSubview:self.iconView];
    [self.shadowView addSubview:self.titleLabel];
    [self.shadowView addSubview:self.segmentView];
    [self.shadowView addSubview:self.baseView];
    [self.shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(viewPix(5));
        make.left.equalTo(self).offset(viewPix(16));
        make.right.equalTo(self).offset(-viewPix(16));
        make.bottom.equalTo(self).offset(viewPix(15));
    }];
    [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self.shadowView).offset(viewPix(12));
        make.width.height.equalTo(@(viewPix(24)));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconView.mas_right).offset(viewPix(6));
        make.centerY.equalTo(self.iconView);
    }];
    [self.segmentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.shadowView).offset(viewPix(48));
        make.left.equalTo(self.shadowView).offset(viewPix(12));
        make.right.equalTo(self.shadowView).offset(-viewPix(12));
        make.height.equalTo(@(0.5));
    }];
    [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.segmentView.mas_bottom).offset(viewPix(12));
        make.left.right.equalTo(self.segmentView);
        make.bottom.equalTo(self.shadowView);
        make.height.equalTo(@(viewPix(6)));
    }];

}
-(UIView *)shadowView{
    if(!_shadowView){
        _shadowView = [UIView shadowViewWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.15 radius:10];
        _shadowView.backgroundColor = [UIColor whiteColor];
    }
    return _shadowView;
}
-(UIImageView *)iconView{
    if(!_iconView){
        _iconView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"添加随访-症状"]];
    }
    return _iconView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"症状" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _titleLabel;
}

-(UIView *)segmentView{
    if(!_segmentView){
        _segmentView = [[UIView alloc]initWithFrame:CGRectMake(viewPix(12), viewPix(48), Screen_W-viewPix(56), 0.5)];
        _segmentView.backgroundColor = [UIColor colorWithString:@"#E8E8E8"];
    }
    return _segmentView;
}

-(UIView *)baseView{
    if(!_baseView){
        _baseView = [[UIView alloc] init];
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}


@end
